using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Web.Core;

namespace Yuanlin.Business
{
    public class PlantSection_Thread : Entity
    {
        private Property<string> subject = new Property<string>();
        private Property<string> body = new Property<string>();
        private Property<string> tags = new Property<string>();
        private Property<int> authorId = new Property<int>();
        private Property<string> author = new Property<string>();
        private Property<int> mostRecentReplierId = new Property<int>();
        private Property<string> mostRecentReplierName = new Property<string>();
        private Property<DateTime> createDate = new Property<DateTime>();
        private Property<DateTime> updateDate = new Property<DateTime>();
        private Property<DateTime> stickDate = new Property<DateTime>();
        private Property<int> sectionId = new Property<int>();
        private Property<int> plantId = new Property<int>();
        private Property<int> threadStatus = new Property<int>();
        private Property<int> totalPosts = new Property<int>();
        private Property<int> totalViews = new Property<int>();
        private Property<int> level = new Property<int>();
        private Property<int> categoryType = new Property<int>();
        private Property<int> categoryId = new Property<int>();

        public Property<string> Subject
        {
            get
            {
                return subject;
            }
            set
            {
                subject = value;
            }
        }
        public Property<string> Tags
        {
            get
            {
                return tags;
            }
            set
            {
                tags = value;
            }
        }
        public Property<string> Author
        {
            get
            {
                return author;
            }
            set
            {
                author = value;
            }
        }
        public Property<string> MostRecentReplierName
        {
            get
            {
                return mostRecentReplierName;
            }
            set
            {
                mostRecentReplierName = value;
            }
        }
        public Property<int> SectionId
        {
            get
            {
                return sectionId;
            }
            set
            {
                sectionId = value;
            }
        }
        public Property<int> TotalPosts
        {
            get
            {
                return totalPosts;
            }
            set
            {
                totalPosts = value;
            }
        }
        public Property<int> TotalViews
        {
            get
            {
                return totalViews;
            }
            set
            {
                totalViews = value;
            }
        }
        public Property<int> ThreadStatus
        {
            get
            {
                return threadStatus;
            }
            set
            {
                threadStatus = value;
            }
        }
        public Property<int> AuthorId
        {
            get
            {
                return authorId;
            }
            set
            {
                authorId = value;
            }
        }
        public Property<int> MostRecentReplierId
        {
            get
            {
                return mostRecentReplierId;
            }
            set
            {
                mostRecentReplierId = value;
            }
        }
        public Property<int> PlantId
        {
            get
            {
                return plantId;
            }
            set
            {
                plantId = value;
            }
        }
        public Property<int> Level
        {
            get
            {
                return level;
            }
            set
            {
                level = value;
            }
        }
        public Property<DateTime> CreateDate
        {
            get
            {
                return createDate;
            }
            set
            {
                createDate = value;
            }
        }
        public Property<DateTime> UpdateDate
        {
            get
            {
                return updateDate;
            }
            set
            {
                updateDate = value;
            }
        }
        public Property<DateTime> StickDate
        {
            get
            {
                return stickDate;
            }
            set
            {
                stickDate = value;
            }
        }
        public Property<string> Body
        {
            get
            {
                return body;
            }
            set
            {
                body = value;
            }
        }
        public Property<int> CategoryType
        {
            get
            {
                return categoryType;
            }
            set
            {
                categoryType = value;
            }
        }
        public Property<int> CategoryId
        {
            get
            {
                return categoryId;
            }
            set
            {
                categoryId = value;
            }
        }

        public override bool IsOwner(User user)
        {
            if (user.EntityId.Value == AuthorId.Value)
            {
                return true;
            }
            return false;
        }
    }
}